<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet"
          integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.0/font/bootstrap-icons.css">
    <meta charset="UTF-8">
    <title>系统账户信息</title>
</head>
<body>
<header class="px-3 py-2 bg-dark text-white">
    <div class="container">
        <div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
            <a href="/index.html"
               class="d-flex align-items-center my-2 my-lg-0 me-lg-auto text-white text-decoration-none">
                <img src="img/icon.png" alt="icon" width="220" height="50">
            </a>
            <ul class="nav col-12 col-lg-auto my-2 justify-content-center my-md-0 text-small">
                <li>
                    <a href="/init.html" class="nav-link text-white">
                        <i class="bi bi-diagram-2"></i>
                        <b>初始化</b>
                    </a>
                </li>
                <li>
                    <a href="/allUsers.html" class="nav-link text-white">
                        <i class="bi bi-people"></i>
                        <b>查看所有账户</b>
                    </a>
                </li>
                <li>
                    <a href="/transaction.html" class="nav-link text-white">
                        <i class="bi bi-cart-check"></i>
                        <b>发起交易</b>
                    </a>
                </li>
                <li>
                    <a href="/audit.html" class="nav-link text-white">
                        <i class="bi bi-ui-checks-grid"></i>
                        <b>审计交易链</b>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</header>

<div class="container" style="background-color: #98fb98; border-radius: 6px; margin-top: 10px">
    <div class="py-2 text-center">
        <h2>查看用户信息</h2>
        <p class="lead">该功能将查看系统内置的所有用户的信息，包括用户地址与用户余额</p>
    </div>
</div>
<div class="py-4 container text-center">
    <h2 style="margin-top: 10px"><i class="bi bi-emoji-laughing"></i>点击下方按钮查看用户信息: </h2>
    <form action="/allUsersInfo" method="get">
        <button class="btn btn-primary" type="submit">查看用户信息</button>
    </form>
    <h2 th:if="${usersInfo.size() == 0}" style="color: red">请先初始化</h2>
</div>

<div class="col-md4" style="float: left; display: inline;">
    <h4 class="pb-2 border-bottom" style="width: 500px; margin-left: 200px">账户地址</h4>
</div>
<div class="col-md4" style="float: left; display: inline;">
    <h4 class="pb-2 border-bottom" style="width: 500px;">账户余额</h4>
</div>
<div class="col-md4" th:each="user: ${usersInfo.values()}">
    <div class="col-md4" style="float: left; display: inline;">
        <p style="width: 500px; margin-left: 200px" th:text="${user.name}"></p>
    </div>
    <div class="col-md4" style="float: left; display: inline;">
        <p style="width: 500px;" th:text="${user.balance}"></p>
    </div>
</div>
</body>
</html>

